/* Listing Styles */

/* Colors taken from https://mdbootstrap.com/css/colors/ */
.ajax-contents-table tbody tr { border-left:2px solid #ddd; }
.ajax-contents-table tbody tr:last-child { border-bottom:1px solid #ddd; }

/* state sample_due */
.ajax-contents-table tr.state-sample_due { border-left:2px solid #ffff8d !important; }
.ajax-contents-table td.result.state-sample_due { border-left:2px solid #ffff8d !important; }
.ajax-contents-table tr.state-sample_due:hover { background-color: rgba(255, 235, 59, 0.1); }

/* state sample_received */
.ajax-contents-table tr.state-sample_received { border-left:2px solid #a1887f !important; }
.ajax-contents-table td.result.state-sample_received { border-left:2px solid #a1887f !important; }
.ajax-contents-table tr.state-sample_received:hover { background-color: rgba(121, 85, 72, 0.1); }

/* state retracted */
.ajax-contents-table tr.state-retracted { border-left:2px solid #ff6f00 !important; }
.ajax-contents-table tr.state-retracted>td:not([rowspan]) { background-color: #eceff1 !important; color: #78909c; font-style: italic; }
.ajax-contents-table td.result.state-retracted { border-left:2px solid #ff6f00 !important; }
.ajax-contents-table tr.state-retracted:hover { background-color: rgba(255, 152, 0, 0.1); }

/* state to_be_verified */
.ajax-contents-table tr.state-to_be_verified { border-left:2px solid #18ffff !important; }
.ajax-contents-table td.result.state-to_be_verified { border-left:2px solid #18ffff !important; }
.ajax-contents-table tr.state-to_be_verified:hover { background-color: rgba(0, 188, 212, 0.1); }

/* state verified */
.ajax-contents-table tr.state-verified { border-left:2px solid #0091ea !important; }
.ajax-contents-table td.result.state-verified { border-left:2px solid #0091ea !important; }
.ajax-contents-table tr.state-verified:hover { background-color: rgba(3, 169, 244, 0.2); }

/* state published */
.ajax-contents-table tr.state-published { border-left:2px solid #00c853 !important; }
.ajax-contents-table td.result.state-published { border-left:2px solid #00c853 !important; }
.ajax-contents-table tr.state-published:hover { background-color: rgba(76, 175, 80, 0.2); }

/* state invalid */
.ajax-contents-table tr.state-invalid { border-left:2px solid #e65100 !important; }
.ajax-contents-table td.result.state-invalid { border-left:2px solid #e65100 !important; }
.ajax-contents-table tr.state-invalid:hover { background-color: rgba(244, 67, 54, 0.2); }

/* state rejected */
.ajax-contents-table tr.state-rejected { border-left:2px solid #abc !important; }
.ajax-contents-table td.result.state-rejected { border-left:2px solid #abc !important; }
.ajax-contents-table tr.state-rejected:hover { background-color: #abc; }

/* state assigned */
.ajax-contents-table tr.state-assigned { border-left:2px solid #ddd; }
.ajax-contents-table td.result.state-assigned { border-left:2px solid transparent; }

/* state unassigned */
.ajax-contents-table tr.state-unassigned { border-left:2px solid #ddd; }
.ajax-contents-table td.result.state-unassigned { border-left:2px solid transparent; }

/* state attachment-due */
.ajax-contents-table tr.state-attachment_due { border-left:2px solid #ffc107 !important; }
.ajax-contents-table td.result.state-attachment_due { border-left:2px solid #ffc107 !important; }
.ajax-contents-table tr.state-attachment_due:hover { background-color: rgba(255, 152, 0, 0.2); }

/* state cancelled */
.ajax-contents-table tr.state-cancelled { border-left:2px solid #000000 !important; }
.ajax-contents-table tr.state-cancelled:hover { background-color: rgba(0, 0, 0, 0.1); }

/* worksheet states */
.ajax-contents-table tr.state-open { border-left:2px solid #ddd  !important; }
.ajax-contents-table tr.state-empty-worksheet { border-left:2px solid #ddd !important; }

/* transposed worksheet layout*/
.ajax-contents-table td.transposed.result.empty { cursor: not-allowed; }
.ajax-contents-table td.transposed.result:hover { background-color: #e3e3e3!important; }
.ajax-contents-table td.transposed.result.empty:hover { background-color: #e3e3e3; }

/* active/inactive states*/
.ajax-contents-table tr.state-active { border-left:2px solid transparent; }
.ajax-contents-table tr.state-inactive { border-left:2px solid #616161; }

.ajax-contents-table th.sortable { cursor: pointer; }
.ajax-contents-table th.sortable:hover { background-color: #ccc; }
.ajax-contents-table th:not(.sortable) { cursor: not-allowed; }

.ajax-contents-table th.active.ascending span:after { content: "▲"; margin-left: 0.5em; }
.ajax-contents-table th.active.descending span:after { content: "▼"; margin-left: 0.5em; }

/* category */
.ajax-contents-table tr.categoryrow { border-left: none; background-color: rgba(96, 125, 139, 0.1)!important; cursor: pointer; font-weight: bold; font-size: 115%; color: #3E4551; }

/* table load mask */
#table-overlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  height: 100%;
  width: 100%;
  background: rgba(96, 125, 139, 0.3);
  opacity: 0.3;
}

/* progress bar */
.ajax-contents-table tr td div.progress { width: 55px; margin-bottom: 0; height: 17px; }
.ajax-contents-table tr td div.progress div.progress-bar { color: #f5f5f5; background-color: #33b5e5; line-height: 17px; font-size: 9px; font-weight:bold; }
.ajax-contents-table tr.state-invalid td div.progress div.progress-bar,
.ajax-contents-table tr.state-cancelled td div.progress div.progress-bar { background-color: #c9c9c9; }

/* collapsible rows */
.ajax-contents-table tr.togglerow { cursor: pointer; }
.ajax-contents-table tr.childrow td:first-child { padding-left: 1em; }
.ajax-contents-table tr.childrow td:first-child:before { content: "➥ "; }

/* before item */
.ajax-contents-table tr span.before-item { display: table-cell; line-height: 0; vertical-align: middle; padding-right: 5px; }

/* after item */
.ajax-contents-table tr span.after-item { display: table-cell; line-height: 0; vertical-align: middle;  padding-left: 5px; }

/* Render table form-controls smaller */
.ajax-contents-table tr td div.form-group { display: inline-table; }

/* Top toolbar */
.ajax-contents-table .top-toolbar { padding-bottom: .5em; }

/* Mark required header columns with a red star */
.ajax-contents-table th.required :before {
    color: red;
    content: "*";
    padding-right: 0.25em;
}

/* Expandable Rows */
.ajax-contents-table tr.contentrow.child td {
    border-top:none;
}
.ajax-contents-table tr.contentrow.collapsed td:first-child:before,
.ajax-contents-table tr.contentrow.expanded td:first-child:before,
.ajax-contents-table tr.contentrow.child td:first-child:before {
    padding-right: 0.5em;
    vertical-align: bottom;
    color: #555;
    cursor: pointer;
}
.ajax-contents-table tr.contentrow.collapsed td:first-child:before {
    content: "▶";
}
.ajax-contents-table tr.contentrow.expanded td:first-child:before {
    content: "▼";
}
.ajax-contents-table tr.contentrow.child td:first-child:before {
    content: "⋯";
}

/* Remark Rows */
.ajax-contents-table tr.remarksrow td {
    padding: 0;
    border: none;
}
.ajax-contents-table tr.remarksrow td div.remarks {
    min-height: 20px;
    padding: 5px;
    margin: 5px;
    background-color: #f5f5f5;
    border: 1px solid #e3e3e3;
    border-radius: 3px;
}

/* Multi select */
.ajax-contents-table tr td div.multiselect {
    max-height: 120px;
    width: 200px;
    overflow: auto;
    border: 1px solid #ccc;
    border-radius: 3px;
}
.ajax-contents-table tr td div.multiselect ul {
    padding: 0;
    margin: 0;
}
.ajax-contents-table tr td div.multiselect li {
    padding: 6px;
}
.ajax-contents-table tr td div.multiselect li:hover {
    background-color: #f9f9f9;
}

/* Rowspan support */
.ajax-contents-table tr td[rowspan] {
    border: 1px solid #ddd;
    background-color: white!important;
}
.ajax-contents-table tr td[rowspan]:hover {
    background-color: white!important;
}

/* borderless table */
.ajax-contents-table table.table-borderless td { border: none!important; }
.ajax-contents-table table.table-borderless tr { border: none!important; }

/* Worksheet's slots table */
.ajax-contents-table table.slot-header-table { margin-bottom: 0px; }

/* Results Unit */
.ajax-contents-table span.unit { padding: 0 0.25em; color: black; }


/* Transposed Cell */
.ajax-contents-table td.transposed span.before-item { width: 60px }
.ajax-contents-table td.transposed span.before-item > * { display: block; float: left; padding-right: 5px; }
.ajax-contents-table td.transposed span.before-item input[type=checkbox] { margin: 0; }
.ajax-contents-table td.transposed input { margin-right: 10px; }
.ajax-contents-table td.transposed .before_field { font-size: 85%; display: table-cell; }
.ajax-contents-table td.transposed .after_field { font-size: 85%; display: table-cell; }
.ajax-contents-table td.transposed span.readonly { padding-right: 0.5em; }

/* Regular Cell */
.ajax-contents-table td a.remarks { display: block; }
